import request from '@/utils/request'
import { Header } from 'element-ui';
import { getToken } from "@/utils/auth"

export function login(data) {

  let requestData = '';

  for (let x in data) {
    requestData += `${x}=${data[x]}&`;
  }

  return request({
    url: '/user/login',
    method: 'post',
    data: requestData
  })
}



export function adduser(data){
   return request({
    url:'/user/addUser',
    method:'POST',
    data,
   })
}

export function getUser(data){
  return request({
    url:'/user/staff',
    method:'GET',
    params:data,
  })
}
export function updatesUser(data){
  return request({
    url:'/user/updateUser',
    method:'POST',
    data
  })
}
export function deleteUser(data){
  return request({
    url:'/user/deleteUser',
    method:'DELETE',
    params:data
  })
}
//修改密码 
export function resetPwd(data){
  return request({
    url:'/user/resetPwd',
    method:'PUT',
    params:data
  })

}